<template>
  <div class="baobaotuan">
    <div class="banner">
      <h2>爆爆团</h2>
      <span>限时爆款 超级低价</span>
    </div>
    <div class="title">
        <span>正在抢购</span>
        <span>上新预告</span>
    </div>
    <div class="goodList">
      <div class="good" v-for="(item, index) in goodArr" :key="index" >
          <div class="pic">
            <img :src="item.picture" alt="">
          </div>
          <div class="goodInfo">
            <h3> {{item.name}} </h3>
            <div class="text">
              <span>￥{{item.min_price}} </span>
              <span>马上抢</span>
            </div>
          </div>
      </div>
    </div>
  </div>
</template>

<script>
import {tuan_list} from '../../utils/api'

export default {
  data() {
    return {
      currentIndex: 0,
      goodArr:[]
    }
  },
  // methods:{
  //   handClick(index) {
  //     this.currentIndex = index;
  //   }
  // },
  mounted() {
    //请求 爆爆团-正在抢购
    tuan_list( {status:1} ).then((res)=>{
      // console.log(res.data);
      this.goodArr = res.data.list
    });
  }

}
</script>

<style scoped>
.baobaotuan .banner {
  text-align: center;
  background-color: rgb(241, 80, 80);


  }
.banner h2{
  padding-top: 10px;
  color: white;
}
.banner span:nth-child(2) {
  font-size: 26px;
  color: white;
  display: block;
  margin: 20px 0 0px 0px;
  padding-bottom: 20px;
}
 .title {
    height: 40px;
    padding: 5px 10px 0px 10px;
    background-color: rgb(241, 80, 80);
  }
  .title span {
    display: inline-block;
    height: 60%;
    border-bottom: 1px solid white;
    margin: 0px 10px 0px 10px;
    color: #ccc;
    font-weight: bolder;
  }
.goodList {
    width: 100%;
    /* background-color: skyblue; */
    overflow: hidden;
  }
  .goodList .good {
    display: flex;
    height: 100px;
    margin: 15px 0px 10px 10px;
  }
  .good .pic {
    width: 35%;
    /* background-color: lightcoral; */
  }
  .pic img {
    width: 100%;
  }
  .good .goodInfo {
    flex: 1;
    /* background-color: skyblue; */
    overflow: hidden;
  }
  .goodInfo h3 {
    padding-left: 10px;
  }
  .goodInfo .text {
    display: flex;
    justify-content: space-between;
    margin: 20px 10px 10px 10px;
  }
  .text span:nth-child(1) {
    color: red;
    font-size: 18px;
    font-weight: bolder;
  }
  .text span:nth-child(2) {
    color: white;
    font-size: 16px;
    font-weight: bolder;
    background-color: rgb(243, 54, 54);
    border-radius: 20px;
    display: inline-block;
    width: 70px;
    text-align: center;
  }

</style>